extends Control


# 控制节点
var line_2d

var music_area_id = -1


func _ready():
	pass 


func set_data(data):
	pass



func set_font_color(color):
	$Label.add_color_override("font_color", color)


func set_line_2d(line_2d):
	self.line_2d = line_2d
	

func set_music_area_id(music_area_id):
	self.music_area_id = music_area_id
	var map_area = DataSource.get_data_by_one(DataSource.map_area, music_area_id)
	if map_area:
		$Label.text = map_area["mapName"]
	


func _on_AudioControlNode_gui_input(event):
	if event is InputEventMouseButton:  
		if event.button_index == BUTTON_RIGHT and event.pressed:  
			# 鼠标右键被按下，弹出操作菜单
			var ui = MainTool.getUILayer().add_ui("res://tool/page/map/mapView/audioArea/AudioAreaRightMenu.tscn")
			ui.set_music_area_id(music_area_id)



func _on_AudioControlNode_mouse_entered():
	self.line_2d.width = 6


func _on_AudioControlNode_mouse_exited():
	self.line_2d.width = 2
